<template>
  <div>
    <button @click="handleSend">发送请求</button>
    <div>{{message}}</div>
  </div>
</template>

<script setup>

import { ref } from 'vue'
import request from './untils/request';

const message = ref('未发送前');
const handleSend = () => {
  console.log('发送请求');
  console.log(import.meta.env.VITE_APP_API_URL );
  console.log(import.meta.env.VITE_BASE_URL);
  request({
    url: '/user/login',
    method: 'POST',
    data: {
      name: 'admin',
      password: '123456'
    }
  }).then(res => {
    message.value = res.data;
  })
}

</script>

<style scoped>
header {
  line-height: 1.5;
}

.logo {
  display: block;
  margin: 0 auto 2rem;
}

@media (min-width: 1024px) {
  header {
    display: flex;
    place-items: center;
    padding-right: calc(var(--section-gap) / 2);
  }

  .logo {
    margin: 0 2rem 0 0;
  }

  header .wrapper {
    display: flex;
    place-items: flex-start;
    flex-wrap: wrap;
  }
}
</style>
